{% extends 'TopxiaAdminBundle::layout.html.twig' %}

{% set menu = 'admin_setting_cloud_edulive' %}
{% set script_controller = 'setting/live-setting' %}

{% block page_title %}
  {% if setting('cloud_status.locked') == true %}
    <div class="alert alert-warning" role="alert">{{'您的教育云服务已被锁定，请联系客服人员：'|trans}}4008041114。</div>
    {{ currentMenu.code|parent_permission.name|trans }}
  {% elseif account.status|default() == 'none' %}
    <div class="alert alert-warning" role="alert">{{'
    您的云直播服务已被暂停，不能使用，请联系客服人员：'|trans}}4008041114。</div>
    {{ currentMenu.code|parent_permission.name|trans }}
  {% else %}
    {{ parent() }}
  {% endif %}
{% endblock %}

{% block main %}
<!-- 设置 -->
{{ web_macro.flash_messages() }}
<div class="page-heading">
  云直播开关
</div>
<form class="form-horizontal" role="form" method="post" novalidate>
  <div class="form-group">
    <label for="" class="col-sm-3 control-label">启用云直播：</label>
    <div class="controls col-md-9 radios">
         <div>
            <span class="text-success">{{ '已启用'|trans }}</span>
            <button type="submit" class="btn btn-default btn-sm mlm" name="live_course_enabled" value="0"><span class="text-muted">{{ '关闭'|trans }}</span></button>
          </div>
      <div class="help-block">
        大班课、小班课、一对一辅导课，云直播让直播课堂更精彩。<a href="{{ path('admin_cloud_show',{'type': 'live'}) }}" target="_blank">点击这里</a>了解详情。
      </div>
    </div>
  </div>
  <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
</form>

{% if capacity.code|default(0) == 2 %}
  <div class="page-heading">
    基本设置
  </div>
  <form class="form-horizontal" id="live-logo-form" role="form" method="post" action="{{path('admin_cloud_upload_live_logo')}}" novalidate>
  <div class="form-group">
    <label for="" class="col-sm-3 control-label">直播LOGO：</label>
    <div class="controls col-md-9">
      <div id="live-course-logo-container">{% if liveCourseSetting.live_logo|default(false) %}<img src="{{ asset(liveCourseSetting.live_logo) }}">{% endif %}</div>
      <a class="btn btn-default btn-sm" id="live-course-logo-upload"
      data-upload-token="{{ upload_token('system', 'image') }}"
      data-url="{{ path('admin_setting_live_logo_upload') }}"
      >{{'上传'|trans}}</a>
      <button class="btn btn-default btn-sm" id="live-course-logo-remove" type="button" data-url="{{ path('admin_setting_live_logo_remove') }}" {% if not liveCourseSetting.live_logo|default(false) %}style="display:none;"{% endif %}>{{'删除'|trans}}</button>
      <p class="help-block">
        <b>{{'只针对直播新方案。'|trans}}</b><br>
        {{'请上传png, gif, jpg格式的图片文件。LOGO图片建议不要超过100*23。'|trans}}</p>
      <input type="hidden" name="live_logo" value="{{ liveCourseSetting.live_logo|default("") }}">
    </div>
  </div>
  <div class="controls col-md-offset-3 col-md-8">
    <button type="submit" class="btn btn-primary">提交</button>
  </div>
  <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
  </form>
{% endif %}
{% endblock %}
